Optimal. Leaf size=366 \[ \frac{a^3 \left (2 a^2+b^2\right ) \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{b d \left (a^2-b^2\right )^{7/2}}-\frac{2 a^3 \left (a^2-3 b^2\right ) \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{b d \left (a^2-b^2\right )^{7/2}}+\frac{2 a b \left (a^2+3 b^2\right ) \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{d \left (a^2-b^2\right )^{7/2}}+\frac{3 a^4 \cos (c+d x)}{2 d \left (a^2-b^2\right )^3 (a+b \sin (c+d x))}+\frac{a^3 \cos (c+d x)}{2 d \left (a^2-b^2\right )^2 (a+b \sin (c+d x))^2}-\frac{a^2 \left (a^2-3 b^2\right ) \cos (c+d x)}{d \left (a^2-b^2\right )^3 (a+b \sin (c+d x))}+\frac{\cos (c+d x)}{2 d (a+b)^3 (1-\sin (c+d x))}+\frac{\cos (c+d x)}{2 d (a-b)^3 (\sin (c+d x)+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.490659, antiderivative size = 366, normalized size of antiderivative = 1., number of steps used = 18, number of rules used = 8, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.296, Rules used = {2897, 2648, 2664, 2754, 12, 2660, 618, 204} \[ \frac{a^3 \left (2 a^2+b^2\right ) \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{b d \left (a^2-b^2\right )^{7/2}}-\frac{2 a^3 \left (a^2-3 b^2\right ) \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{b d \left (a^2-b^2\right )^{7/2}}+\frac{2 a b \left (a^2+3 b^2\right ) \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{d \left (a^2-b^2\right )^{7/2}}+\frac{3 a^4 \cos (c+d x)}{2 d \left (a^2-b^2\right )^3 (a+b \sin (c+d x))}+\frac{a^3 \cos (c+d x)}{2 d \left (a^2-b^2\right )^2 (a+b \sin (c+d x))^2}-\frac{a^2 \left (a^2-3 b^2\right ) \cos (c+d x)}{d \left (a^2-b^2\right )^3 (a+b \sin (c+d x))}+\frac{\cos (c+d x)}{2 d (a+b)^3 (1-\sin (c+d x))}+\frac{\cos (c+d x)}{2 d (a-b)^3 (\sin (c+d x)+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2897
Rule 2648
Rule 2664
Rule 2754
Rule 12
Rule 2660
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{\sin (c+d x) \tan ^2(c+d x)}{(a+b \sin (c+d x))^3} \, dx &=\int \left (-\frac{1}{2 (a+b)^3 (-1+\sin (c+d x))}-\frac{1}{2 (a-b)^3 (1+\sin (c+d x))}+\frac{a^3}{b \left (a^2-b^2\right ) (a+b \sin (c+d x))^3}+\frac{-a^4+3 a^2 b^2}{b \left (-a^2+b^2\right )^2 (a+b \sin (c+d x))^2}-\frac{b \left (a^3+3 a b^2\right )}{\left (-a^2+b^2\right )^3 (a+b \sin (c+d x))}\right ) \, dx\\ &=-\frac{\int \frac{1}{1+\sin (c+d x)} \, dx}{2 (a-b)^3}-\frac{\int \frac{1}{-1+\sin (c+d x)} \, dx}{2 (a+b)^3}-\frac{\left (a^2 \left (a^2-3 b^2\right )\right ) \int \frac{1}{(a+b \sin (c+d x))^2} \, dx}{b \left (a^2-b^2\right )^2}+\frac{a^3 \int \frac{1}{(a+b \sin (c+d x))^3} \, dx}{b \left (a^2-b^2\right )}+\frac{\left (a b \left (a^2+3 b^2\right )\right ) \int \frac{1}{a+b \sin (c+d x)} \, dx}{\left (a^2-b^2\right )^3}\\ &=\frac{\cos (c+d x)}{2 (a+b)^3 d (1-\sin (c+d x))}+\frac{\cos (c+d x)}{2 (a-b)^3 d (1+\sin (c+d x))}+\frac{a^3 \cos (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))^2}-\frac{a^2 \left (a^2-3 b^2\right ) \cos (c+d x)}{\left (a^2-b^2\right )^3 d (a+b \sin (c+d x))}-\frac{\left (a^2 \left (a^2-3 b^2\right )\right ) \int \frac{a}{a+b \sin (c+d x)} \, dx}{b \left (a^2-b^2\right )^3}-\frac{a^3 \int \frac{-2 a+b \sin (c+d x)}{(a+b \sin (c+d x))^2} \, dx}{2 b \left (a^2-b^2\right )^2}+\frac{\left (2 a b \left (a^2+3 b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac{1}{2} (c+d x)\right )\right )}{\left (a^2-b^2\right )^3 d}\\ &=\frac{\cos (c+d x)}{2 (a+b)^3 d (1-\sin (c+d x))}+\frac{\cos (c+d x)}{2 (a-b)^3 d (1+\sin (c+d x))}+\frac{a^3 \cos (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))^2}+\frac{3 a^4 \cos (c+d x)}{2 \left (a^2-b^2\right )^3 d (a+b \sin (c+d x))}-\frac{a^2 \left (a^2-3 b^2\right ) \cos (c+d x)}{\left (a^2-b^2\right )^3 d (a+b \sin (c+d x))}+\frac{a^3 \int \frac{2 a^2+b^2}{a+b \sin (c+d x)} \, dx}{2 b \left (a^2-b^2\right )^3}-\frac{\left (a^3 \left (a^2-3 b^2\right )\right ) \int \frac{1}{a+b \sin (c+d x)} \, dx}{b \left (a^2-b^2\right )^3}-\frac{\left (4 a b \left (a^2+3 b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac{1}{2} (c+d x)\right )\right )}{\left (a^2-b^2\right )^3 d}\\ &=\frac{2 a b \left (a^2+3 b^2\right ) \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{\left (a^2-b^2\right )^{7/2} d}+\frac{\cos (c+d x)}{2 (a+b)^3 d (1-\sin (c+d x))}+\frac{\cos (c+d x)}{2 (a-b)^3 d (1+\sin (c+d x))}+\frac{a^3 \cos (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))^2}+\frac{3 a^4 \cos (c+d x)}{2 \left (a^2-b^2\right )^3 d (a+b \sin (c+d x))}-\frac{a^2 \left (a^2-3 b^2\right ) \cos (c+d x)}{\left (a^2-b^2\right )^3 d (a+b \sin (c+d x))}+\frac{\left (a^3 \left (2 a^2+b^2\right )\right ) \int \frac{1}{a+b \sin (c+d x)} \, dx}{2 b \left (a^2-b^2\right )^3}-\frac{\left (2 a^3 \left (a^2-3 b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac{1}{2} (c+d x)\right )\right )}{b \left (a^2-b^2\right )^3 d}\\ &=\frac{2 a b \left (a^2+3 b^2\right ) \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{\left (a^2-b^2\right )^{7/2} d}+\frac{\cos (c+d x)}{2 (a+b)^3 d (1-\sin (c+d x))}+\frac{\cos (c+d x)}{2 (a-b)^3 d (1+\sin (c+d x))}+\frac{a^3 \cos (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))^2}+\frac{3 a^4 \cos (c+d x)}{2 \left (a^2-b^2\right )^3 d (a+b \sin (c+d x))}-\frac{a^2 \left (a^2-3 b^2\right ) \cos (c+d x)}{\left (a^2-b^2\right )^3 d (a+b \sin (c+d x))}+\frac{\left (4 a^3 \left (a^2-3 b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac{1}{2} (c+d x)\right )\right )}{b \left (a^2-b^2\right )^3 d}+\frac{\left (a^3 \left (2 a^2+b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac{1}{2} (c+d x)\right )\right )}{b \left (a^2-b^2\right )^3 d}\\ &=-\frac{2 a^3 \left (a^2-3 b^2\right ) \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{b \left (a^2-b^2\right )^{7/2} d}+\frac{2 a b \left (a^2+3 b^2\right ) \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{\left (a^2-b^2\right )^{7/2} d}+\frac{\cos (c+d x)}{2 (a+b)^3 d (1-\sin (c+d x))}+\frac{\cos (c+d x)}{2 (a-b)^3 d (1+\sin (c+d x))}+\frac{a^3 \cos (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))^2}+\frac{3 a^4 \cos (c+d x)}{2 \left (a^2-b^2\right )^3 d (a+b \sin (c+d x))}-\frac{a^2 \left (a^2-3 b^2\right ) \cos (c+d x)}{\left (a^2-b^2\right )^3 d (a+b \sin (c+d x))}-\frac{\left (2 a^3 \left (2 a^2+b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac{1}{2} (c+d x)\right )\right )}{b \left (a^2-b^2\right )^3 d}\\ &=-\frac{2 a^3 \left (a^2-3 b^2\right ) \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{b \left (a^2-b^2\right )^{7/2} d}+\frac{a^3 \left (2 a^2+b^2\right ) \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{b \left (a^2-b^2\right )^{7/2} d}+\frac{2 a b \left (a^2+3 b^2\right ) \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{\left (a^2-b^2\right )^{7/2} d}+\frac{\cos (c+d x)}{2 (a+b)^3 d (1-\sin (c+d x))}+\frac{\cos (c+d x)}{2 (a-b)^3 d (1+\sin (c+d x))}+\frac{a^3 \cos (c+d x)}{2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))^2}+\frac{3 a^4 \cos (c+d x)}{2 \left (a^2-b^2\right )^3 d (a+b \sin (c+d x))}-\frac{a^2 \left (a^2-3 b^2\right ) \cos (c+d x)}{\left (a^2-b^2\right )^3 d (a+b \sin (c+d x))}\\ \end{align*}
Mathematica [A] time = 3.26788, size = 204, normalized size = 0.56 \[ \frac{\frac{6 a b \left (3 a^2+2 b^2\right ) \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{\left (a^2-b^2\right )^{7/2}}+\frac{a^2 \cos (c+d x) \left (b \left (a^2+6 b^2\right ) \sin (c+d x)+2 a^3+5 a b^2\right )}{(a-b)^3 (a+b)^3 (a+b \sin (c+d x))^2}+\sin \left (\frac{1}{2} (c+d x)\right ) \left (\frac{2}{(a+b)^3 \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )}-\frac{2}{(a-b)^3 \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )}\right )}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.145, size = 702, normalized size = 1.9 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.16709, size = 2030, normalized size = 5.55 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.28636, size = 509, normalized size = 1.39 \begin{align*} \frac{\frac{3 \,{\left (3 \, a^{3} b + 2 \, a b^{3}\right )}{\left (\pi \left \lfloor \frac{d x + c}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (a\right ) + \arctan \left (\frac{a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + b}{\sqrt{a^{2} - b^{2}}}\right )\right )}}{{\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \sqrt{a^{2} - b^{2}}} + \frac{2 \,{\left (3 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - a^{3} - 3 \, a b^{2}\right )}}{{\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )}{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 1\right )}} + \frac{3 \, a^{4} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 4 \, a^{2} b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 2 \, a^{5} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 9 \, a^{3} b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 10 \, a b^{4} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 5 \, a^{4} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 16 \, a^{2} b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 2 \, a^{5} + 5 \, a^{3} b^{2}}{{\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )}{\left (a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 2 \, b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + a\right )}^{2}}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]